<template>
	<view class="contents">
		<!-- 搜索框 -->
		<view class="search" style="position: relative;top:0">
			<view class="search-c" @click="goSearch" v-bind:class="$store.state.searchStyle">
				<image class="icon search-icon" src="/static/image/zoom.png"></image>

				<view class="search-input search-input-p">
					<view class="search-input-p-c">{{ searchKey }}</view>
				</view>
			</view>
		</view>


		<!--轮播-->
		<view class="page-section swiper" style="background-color: #fff;padding-top: 4px;">
			<view class="page-section-spacing" style="margin: 0px 16px;">
				<swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay"  :duration="duration">
					<swiper-item>
						<view class="swiper-item" style="height: 100%;">
							<image src="../../static/images/banner@3x.png" style="width: 100%;border-radius: 3px;height: 100%;"></image>
						</view>
					</swiper-item>
				<!-- 	<swiper-item>
						<view class="swiper-item" style="height: 100%;">
							<image src="" style="width: 100%;border-radius: 3px;height: 100%;"></image>
						</view>
					</swiper-item> -->
				</swiper>
			</view>
		</view>
		
		<!--公告栏-->
		<view class="notice bottom-cell-group" >
			<view class="notice-icon">
				<image class="icon news-icon" src="/static/image/news.png" mode=""></image>
			</view>
			<swiper class="notice-c" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000" :vertical="true" :circular="true">
				<swiper-item v-for="item in noticeInfo" @click="goNotice(item.id)">
					<view class="swiper-item">{{item.title}}</view>
				</swiper-item>
			</swiper>
		</view>
		
	
		<view class="search" style="height: 222upx;position: relative;top:0;z-index: 0;">
			<view class="service-wrapper">
				<view class="service-item" v-for="(item,index) in carTTitleypeArr" :key="index"   @click="hanldcarTypeArr(item,index)" >
					<image :src="item.logo"></image>
					<view class="service-text">{{item.name}}</view>
				</view>
			</view>
		</view>
		
		<!--分类-->
		<view style="background-color: #fff;">
			<view class="device-wrapper">
				
			<view class="dev-item">
				<image src="../../static/images/bianzu3.png" style="height: 100%;width: 100%;" @click="hanldOil()"></image>
			</view>
			<view class="dev-item">
				<view class="dchild-wrapper">
					<view class="dchild-item" @click="hanldIndex()">
						<image src="../../static/images/bianzu4.png" style="height: 100%;;width: 100%;" ></image>
					</view>
					<view class="dchild-item" @click="hanldTire()">
						<image src="../../static/images/bianzu2.png" style="height: 100%;width: 100%;padding-top: 10upx;" ></image>
					</view>
				</view>
			</view>
			</view>
		</view>
		
		
		
		<view class="car-title">精选泵车
			<text style="font-size: 12px;color: #999999;font-weight: normal;padding-left: 22upx;">优质品牌 放心之选</text>
			<text class="dev-c" @click="hanldPumpTruck()">更多泵车</text>
			<image src="../../static/image/right.png" style="    width: 30upx;
    height: 38upx;
    position: absolute;
    right: 20upx;
    top: 31px;"></image>
			
		</view>
		<!-- 条件筛选 -->

		<!-- 高级赛选 -->
		<lvv-popup position="top" ref="lvvpopref" style="background: none;">
			<view class="fliter-c">
				<scroll-view scroll-y="true" style="height: 100%;">
					<view class="fliter-item">
						<view class="cell-item right-img">
							<view class="cell-item-hd">
								<view class="cell-hd-title">价格区间</view>
							</view>
						</view>
						<view class="fliter-i-c">
							<view class="fic-item"><input class="fic-item-input" type="number" v-model="sPrice" /></view>
							<view class="fic-item-line"></view>
							<view class="fic-item"><input class="fic-item-input" type="number" v-model="ePrice" /></view>
						</view>
					</view>
					<view class="fliter-item" v-if="cat_list.length > 0">
						<view class="cell-item right-img">
							<view class="cell-item-hd">
								<view class="cell-hd-title">分类</view>
							</view>
						</view>
						<view class="fliter-i-c">
							<view v-for="item in cat_list" :key="item.goods_cat_id" v-if="item.goods_cat_id && item.name" @click="selectKey('cat_list', item.goods_cat_id)">
								<view class="fic-item" v-if="!item.isSelect">
									<view class="fic-item-text two-line">{{ item.name }}</view>
								</view>
								<view class="fic-item fic-item-active" v-else-if="item.isSelect">
									<view class="fic-item-text two-line">{{ item.name }}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="fliter-item" v-if="brand_list.length > 0">
						<view class="cell-item right-img">
							<view class="cell-item-hd">
								<view class="cell-hd-title">品牌</view>
							</view>
						</view>
						<view class="fliter-i-c">
							<view v-for="item in brand_list" :key="item.brand_id" v-if="item.brand_id && item.name" @click="selectKey('brand_list', item.brand_id)">
								<view class="fic-item" v-if="!item.isSelect">
									<view class="fic-item-text two-line">{{ item.name }}</view>
								</view>
								<view class="fic-item fic-item-active" v-else-if="item.isSelect">
									<view class="fic-item-text two-line">{{ item.name }}</view>
								</view>
							</view>
						</view>
					</view>
					<view class="fliter-item" v-if="label_list.length > 0">
						<view class="cell-item right-img">
							<view class="cell-item-hd">
								<view class="cell-hd-title">标签</view>
							</view>
						</view>
						<view class="fliter-i-c">
							<view v-for="item in label_list" :key="item.id" v-if="item.id && item.name" @click="selectKey('label_list', item.id)">
								<view class="fic-item" v-if="!item.isSelect">
									<view class="fic-item-text two-line">{{ item.name }}</view>
								</view>
								<view class="fic-item fic-item-active" v-else-if="item.isSelect">
									<view class="fic-item-text two-line">{{ item.name }}</view>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
				<view class="button-bottom">
					<button class="btn btn-square" @click="toclose()">关闭</button>
					<button class="btn btn-b btn-square" @click="filterOk()">确定</button>
				</view>
			</view>
		</lvv-popup>

		<!-- 商品列表 -->
		<scroll-view  :scroll-into-view="toView" class="scroll-Y weixinscy" @scrolltolower="lower"
		 enable-back-to-top="false" lower-threshold="45" >
			<!-- 表格图片 -->
			<view class="img-grids" v-show="current === 0">
				<view v-if="goodsList.length > 0">
					<view class="img-grids-item" v-for="(item, index) in goodsList" :key="index" @click="goodsDetail(item.id)">
						<image class="img-grids-item-t have-none" :src="item.image_url" mode="aspectFill"></image>
						<view class="img-grids-item-b">
							<view class="goods-name grids-goods-name">{{ item.name }}</view>
							<view class="goods-item-c">
								<view class="goods-price red-price">{{ item.price }}万</view>
								<image class="goods-cart" src="/static/image/ic-car.png"></image>
							</view>
						</view>
					</view>
				</view>
				<!-- 无数据时默认显示 -->
				<view class="order-none" v-else>
					<image class="order-none-img" src="/static/image/order.png" mode=""></image>
				</view>
			</view>

			<!-- 列表图片 -->
			<view class="img-list" v-show="current === 1">
				<view v-if="goodsList.length > 0">
					<view class="img-list-item" v-for="(item, index) in goodsList" :key="index" @click="goodsDetail(item.id)" style="margin-bottom: 0;    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center; align-items: end;">
						<image class="img-list-item-l" :src="item.image_url" mode="aspectFill" style="width: 192upx;height: 150upx;border-radius: 3px;border:none"></image>
						<view class="img-list-item-r" style="min-height: auto;padding: 0;    width: 496upx;">
							<view class=" list-goods-name" style="font-weight: bold; text-overflow: inherit;  overflow: inherit;    color: #1E1F20;
    width: 100%;font-size: 15px;">{{ item.name }}</view>
	
	<view style="display: flex;flex-direction: row;    align-items: end;">
		
							<view class="goods-item-c">
								<!-- <view style="color: #666666;font-size: 10px;padding-bottom: 6px;">{{item.factory_date}}年出厂<text style="color: #CCCCCC;padding: 0 5px;">|</text>广州</view> -->
								<view style="color: #666666;font-size: 10px;padding-bottom: 6px;">{{item.factory_date}}  | {{item.hours}}小时 | {{item.address}}</view>
								<view class="list-detail"><!-- 
									<text style="width:29px;height:15px;background:rgba(233,146,62,0.1);border-radius:1px;color: #E9923E;font-size: 9px;padding: 5px;margin-right: 5px;" v-if="item.trade_type==1">自营</text>
									<text style="width:29px;height:15px;background:rgba(233,146,62,0.1);border-radius:1px;color: #E9923E;font-size: 9px;padding: 5px;margin-right: 5px;"  v-if="item.trade_type==2">车商</text>
									<text style="width:29px;height:15px;background:rgba(233,146,62,0.1);border-radius:1px;color: #E9923E;font-size: 9px;padding: 5px;margin-right: 5px;"  v-if="item.trade_type==3">急售</text>
									<text style="width:29px;height:15px;background:rgba(6,139,248,0.1);border-radius:1px;color: #068BF8;font-size: 9px;padding: 5px;" v-if="item.transfer_type==1">可过户</text>
									<text style="width:29px;height:15px;background:rgba(6,139,248,0.1);border-radius:1px;color: #068BF8;font-size: 9px;padding: 5px;" v-if="item.transfer_type==2">不可过户</text>
									 -->
									<text style="width:29px;height:15px;background:rgba(233,146,62,0.1);border-radius:1px;color: #E9923E;font-size: 9px;padding: 3px 5px;margin-right: 5px;">{{item.trade_type}}</text>
									<text style="width:29px;height:15px;background:rgba(6,139,248,0.1);border-radius:1px;color: #068BF8;font-size: 9px;padding: 3px 5px;">{{item.transfer_type}}</text>
								</view>
								<view class="goods-price red-price">{{ item.price }}万</view>
							</view>
							<view class="list-right-1" style="width: 124upx;text-align: right; ">
									<view  v-if="item.type==2">
										<image  src="/static/images/kong.png" style="width: 50px;height: 50px;"></image>
									</view>
									<view style="width:54px;height:25px;border-radius:3px;border:1px solid rgba(6,139,248,1);text-align: center;line-height: 25px;font-size: 14px;color: #068BF8;margin: 0 0 0 auto;"  @click.stop="hanldPhone(item.id)"  v-if="item.type==1">询价</view>
									<!-- <text style="color: #999999;font-size: 10px;text-align: right;margin-top: 30upx;display: block;">{{item.ctime.substring(5,10)}}发布</text> -->
								</view>
							</view>
						</view>
					
					</view>
					<uni-load-more
					:status="loadStatus"
					></uni-load-more>
				</view>
				<view class="order-none" v-else>
					<image class="order-none-img" src="/static/image/order.png" mode=""></image>
				</view>
			</view>
		</scroll-view>
	
	<!--咨询-->
	<uni-popup ref="popup_mask" type="center" :maskClick="maskClick">
		<view class="father-wrapper">
				<view id="son">
					<view style="margin-top: 18px;font-size: 17px;color: #333;font-weight: bold;">免费通话</view>
					<image src="/static/images/baotuiyuan.png" style="width: 24px;height: 24px;float: right; margin-top: -24px;
		margin-right: 16px;"></image>
					<view style="font-weight: normal;font-size: 12px;color: #666666;padding: 21px 16px 15px 16px">对设备感兴趣？你的所有问题一通电话全解决！</view>
					<view class="fee-input" style="font-size: 17px;color: #333;font-weight: bold;">{{shop_mobile}}</view>
					<view class="fee-but"  @click="hanldCall()">确定</view>
				</view>
			</view>
	</uni-popup>
	
	</view>
</template>

<script>
	import lvvPopup from '@/components/lvv-popup/lvv-popup.vue';
	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'
	//下拉框
	import slFilter from '@/components/sl-filter/sl-filter.vue';
	export default {
		data() {
			return {

				//轮播
				indicatorDots: false,
				autoplay: true,
				// interval: 2000,
				duration: 500,
				maskClick:true,
				//
				themeColor: '#000000',
				titleColor: '#666666',
				filterResult: '',
				menuList: [{
						'title': '品牌',
						'detailTitle': '请选择职位类型（可多选）(默认值为[1,2,5])',
						'isMutiple': true,
						'key': 'jobType',
						'defaultSelectedIndex': [1, 2, 5],
						'detailList': [{
								'title': '不限',
								'value': ''
							},
							{
								'title': 'uni-app',
								'value': 'uni-app'
							},
							{
								'title': 'java开发',
								'value': 'java'
							},
							{
								'title': 'web开发',
								'value': 'web'
							},
							{
								'title': 'Android开发',
								'value': 'Android'
							},
							{
								'title': 'iOS开发',
								'value': 'iOS'
							},
							{
								'title': '测试工程师',
								'value': '测试'
							},
							{
								'title': 'UI设计',
								'value': 'UI'
							}
						]
					},
					{
						'title': '泵车',
						'key': 'salary',
						'isMutiple': true,
						'detailList': [{
								'title': '不限',
								'value': ''
							},
							{
								'title': '0~2000',
								'value': '0~2000'
							},
							{
								'title': '2000~3000',
								'value': '2000~3000'
							},
							{
								'title': '3000~4000',
								'value': '3000~4000'
							}
						]
					},
					{
						'title': '年限',
						'key': 'single',
						'isMutiple': false,
						'reflexTitle': true,
						'detailTitle': '请选择（单选）(默认值为1)',
						'defaultSelectedIndex': 1,
						'detailList': [{
								'title': '不限',
								'value': ''
							},
							{
								'title': '条件1',
								'value': 'test_1'
							},
							{
								'title': '条件2',
								'value': 'test_2'
							},
							{
								'title': '条件3',
								'value': 'test_3'
							},
							{
								'title': '条件4',
								'value': 'test_4'
							},
							{
								'title': '条件5',
								'value': 'test_5'
							},
							{
								'title': '条件6',
								'value': 'test_6'
							}

						]
					},
					{
						'title': '价格',
						'key': 'sort',
						'isSort': true,
						'reflexTitle': true,
						'defaultSelectedIndex': 2,
						'detailList': [{
								'title': '默认排序',
								'value': ''
							},
							{
								'title': '发布时间',
								'value': 'add_time'
							},
							{
								'title': '薪资最高',
								'value': 'wages_up'
							},
							{
								'title': '离我最近',
								'value': 'location'
							}
						]
					}
				],

				//
				current: 1,
				id: '',
				showView: false,
				goodsList: [],
				minPrice: '',
				maxPrice: '',
				ajaxStatus: false,
				loading: true,
				loadingComplete: false,
				nodata: false,
				toView: '',
				searchData: {
					where: {},
					order: {
						key: 'sort',
						sort: 'asc'
					}
				},
				searchKey: '请输入二手车编号或者关键字进行搜索', //关键词
				alllist: true,
				allgrid: false,
				screents: true,
				screentc: false,
				sPrice: '',
				ePrice: '',
				brand_list: [],
				cat_list: [],
				label_list: [],
				carTTitleypeArr:[],//泵车
				loadStatus: 'more',
				page: 1,
				limit: 10,//每页显示几条
				refresh:false,
				noticeInfo:'',
				shop_mobile:''
			}
		},
		components: {
			uniLoadMore
		},
		//加载执行
		onLoad: function(options) {
			this.getAnnouncement()
			var where = {};
			if (options.id) {
				where = {
					cat_id: options.id
				};
			}
			if (options.key) {
				where = {
					search_name: options.key
				};
				this.searchKey = options.key;
			}
			if (options.type) {
				if (options.type == 'hot') {
					where = {
						hot: true
					};
				}
				if (options.type == 'recommend') {
					where = {
						recommend: true
					};
				}
			}
			if (options.cat_id) {
				where.cat_id = options.cat_id;
			}
			if (options.brand_id) {
				where.brand_id = options.brand_id;
			}
			if (options.hot) {
				where.hot = options.hot;
			}
			if (options.recommend) {
				where.recommend = options.recommend;
			}
			if (options.label_id) {
				where.label_id = options.label_id;
			}
			this.setSearchData({
				where: where
			});

			this.getGoods();
			this.getcarGettype();
		},
onShow() {
	this.getAnnouncement();
	if(this.$db.get('userToken')){
		this.initData()
	}
	
},
onShareAppMessage: function () {
	 
	 },
		onReachBottom () {
				if (this.loadStatus === 'more') {
					this.getGoods()
				}
			},
		components: {
			lvvPopup,
			slFilter
		},
		methods: {
			//问底价
			hanldPhone(id){
				// uni.navigateTo({
				// 	url:'freeCall'
				// })
			
				  this.$refs.popup_mask.open()
				let data = {
					car_id:id
				}
				this.$api.carinquiry(data, res => {
					if (res.status == true) {
						console.log('询价了')
					}
			})
			},
			//打电话
			hanldCall() {
				let that = this;
				that.$refs.popup_mask.close()
				console.log(typeof that.shop_mobile)
				  wx.makePhoneCall({
					phoneNumber: that.shop_mobile+''
				  });
			},
			initData() {
				// 获取用户信息
				var _this = this
				//判断是开启分销还是原始推广
				this.$api.shopConfig(res => {
					this.config = res;
					this.shop_mobile = this.config.shop_mobile;
					console.log(this.shop_mobile+'show_mm')
					
				})
				},
			//公告
			getAnnouncement() {
				this.$api.noticeList({}, res => {
					if (res.status) {
						this.noticeInfo = res.data; 
						console.log("this.notice")
						console.log(this.noticeInfo)
						}
						})
			},
			// 点击公告
			goNotice(id) {
				// 文章详情
				this.$common.navigateTo('/pages/article/index?id=' + id+'&id_type=2')
			},
			//获取类型
			getcarGettype() {
				this.$api.carGettype({}, res => {
					if (res.status) {
						this.carTTitleypeArr = res.data.car_type; //设备类型
						}
						})
			},
			hanldPumpTruck(){
				uni.switchTab({
				    url: '/pages/secondCar/secondCar'
				});
			},
			hanldcarTypeArr(item,index){
				uni.setStorageSync('carIndex_type',item);  //把需要传递的参数设置为本地缓存
				uni.switchTab({
				    url: '/pages/secondCar/secondCar'
				});

			},
			//油料
			hanldOil(){
				let indexId = 3;
				 this.$common.navigateTo('/pages/classify/productList?indexId='+indexId+'&title=油料');
			},
			
			//轮胎
			hanldTire(){
				let indexId = 2;
				 this.$common.navigateTo('/pages/classify/productList?indexId='+indexId+'&title=轮胎');
			},
			//电器
			hanldIndex(){
				let indexId = 17;
				 this.$common.navigateTo('/pages/classify/productList?indexId='+indexId+'&title=电器');
			},
			//我要买车
			hanldbuyCar() {
				this.$common.navigateTo("buyCar")
			},
			//我要卖车
			hanldsellCar() {
				this.$common.navigateTo("sellCar")
			},

			listGrid() {
				if (this.current == 0) {
					this.current = 1;
				} else {
					this.current = 0;
				}
			},
			//设置查询条件
			setSearchData: function(searchData, clear = false) {
				var sd = this.searchData;
				this.searchData = this.$common.deepCopy(sd, searchData);
				if (clear) {
					this.goodsList = [];
				}
			},
			onChangeShowState: function() {
				var _this = this;
				_this.showView = !_this.showView;
			},
			//点击综合排序
			comprehensive: function() {
				this.setSearchData({
						order: {
							key: 'sort',
							sort: 'asc'
						},
						page: 1
					},
					true
				);
				this.getGoods();
			},
		

			//页面相关事件处理函数--监听用户下拉动作
			onPullDownRefresh: function() {},
			//跳转到商品详情页面
			goodsDetail: function(id) {
				let url = '/pages/goods/index/carInfo?id=' + id;
				this.$common.navigateTo(url);
			},
		getGoods() {
				let that = this;
				let listsrr = '{"trade_type":"","car_type":"1","year_f":"""year_t":"","price_f":"","price_t":"","brand_id":""}'
				console.log(listsrr)
				let data = {
					page: that.page,
					limit: that.limit,
					order:'sort asc',
					where:listsrr
				}
				that.loadStatus = 'loading'
				that.$api.cargetlist(data, function(res) {
					if (res.status) {
						console.log(res.total_page+"total_page")
						if (that.page >= res.data.total_page) {
							// 没有数据了
							that.loadStatus = 'noMore'
						} else {
							// 未加载完毕
							that.loadStatus = 'more'
							that.page ++
						}
					that.goodsList = [...that.goodsList, ...res.data.list];
						console.log(that.goodsList)
					} else {
						that.$common.errorToShow(res.msg)
					}
				});
			},
		
			listgrid: function() {
				let _this = this;
				if (_this.alllist) {
					_this.allgrid = true;
					_this.listgrid = true;
					_this.alllist = false;
				} else {
					_this.allgrid = false;
					_this.listgrid = false;
					_this.alllist = true;
				}
			},
			// 统一返回筛选条件 查询条件 分页
			conditions() {
				let data = this.searchData;
				var newData = {};
				newData = this.$common.deepCopy(newData, data);
				//把data里的where换成json
				if (data.where) {
					newData.where = JSON.stringify(data.where);
				}
				//把排序换成字符串
				if (data.order) {
					var sort = data.order.key + ' ' + data.order.sort;
					if (data.order.key != 'sort') {
						sort = sort + ',sort asc'; //如果不是综合排序，增加上第二个排序优先级排序
					}
					newData.order = sort;
				} else {
					newData.order = 'sort asc';
				}
				return newData;
			},
			//老搜索
			search() {
				this.setSearchData({
						page: 1,
						where: {
							search_name: this.keyword
						}
					},
					true
				);
				this.getGoods();
			},
			//去搜索
			goSearch() {
				let pages = getCurrentPages();
				let prevPage = pages[pages.length - 2];
				// #ifdef H5 || MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE || MP-TOUTIAO
				if (prevPage && prevPage.route) {
					let search_flag = prevPage.route;
					if (search_flag == 'pages/index/search1') {
						uni.navigateBack({
							delta: 1
						});
					} else {
						this.$common.navigateTo('/pages/index/search1');
					}
				} else {
					this.$common.navigateTo('/pages/index/search1');
				}
				// #endif

				// #ifdef MP-ALIPAY
				if (prevPage && prevPage.__proto__.route) {
					let search_flag = prevPage.__proto__.route;
					if (search_flag == 'pages/index/search') {
						uni.navigateBack({
							delta: 1
						});
					} else {
						this.$common.navigateTo('/pages/index/search');
					}
				} else {
					this.$common.navigateTo('/pages/index/search');
				}
				// #endif
			},
			//筛选条件弹出窗口
			toshow() {
				this.$refs.lvvpopref.show();
				this.screents = false;
				this.screentc = true;
			},
			//关闭筛选
			toclose() {
				this.$refs.lvvpopref.close();
				this.screentc = false;
				this.screents = true;
			},
			//取消筛选
			filterNo() {
				this.ePrice = '';
				this.sPrice = '';
				for (let i = 0; i < this.cat_list.length; i++) {
					this.cat_list[i].isSelect = false;
				}
				for (let i = 0; i < this.brand_list.length; i++) {
					this.brand_list[i].isSelect = false;
				}
				for (let i = 0; i < this.label_list.length; i++) {
					this.label_list[i].isSelect = false;
				}
				this.filterOk();
				this.toclose();
			},
			//确认筛选
			filterOk() {
				let data = this.searchData;

				//获取分类
				// data.where.cat_id = '';
				for (let i = 0; i < this.cat_list.length; i++) {
					if (this.cat_list[i].isSelect) {
						data.where.cat_id = this.cat_list[i].goods_cat_id;
					}
				}

				//获取多个品牌
				let brand_ids = '';
				for (let i = 0; i < this.brand_list.length; i++) {
					if (this.brand_list[i].isSelect) {
						brand_ids += this.brand_list[i].brand_id + ',';
					}
				}
				if (brand_ids) {
					brand_ids = brand_ids.substr(0, brand_ids.length - 1);
				}
				data.where.brand_id = brand_ids;

				//获取标签
				data.where.label_id = '';
				for (let i = 0; i < this.label_list.length; i++) {
					if (this.label_list[i].isSelect) {
						data.where.label_id = this.label_list[i].id;
					}
				}

				//价格区间
				data.where.price_f = '';
				data.where.price_t = '';
				if (
					this.sPrice * 1 < 0 ||
					(this.ePrice != '' && this.ePrice <= 0) ||
					this.ePrice * 1 < 0 ||
					(this.sPrice * 1 > this.ePrice * 1 && this.sPrice != '' && this.ePrice != '')
				) {
					this.$common.errorToShow('价格区间有误');
					return false;
				} else {
					data.where.price_f = this.sPrice;
					data.where.price_t = this.ePrice;
				}

				this.setSearchData(data, true);
				this.getGoods();
				this.toclose();
			},
			//选择
			selectKey(type, id) {
				//分类一次只能选择一个
				if (type == 'cat_list') {
					for (let i = 0; i < this.cat_list.length; i++) {
						if (this.cat_list[i].goods_cat_id == id) {
							this.cat_list[i].isSelect = this.cat_list[i].isSelect ? false : true;
						} else {
							this.cat_list[i].isSelect = false;
						}
					}
				}

				if (type == 'brand_list') {
					for (let i = 0; i < this.brand_list.length; i++) {
						if (this.brand_list[i].brand_id == id) {
							this.brand_list[i].isSelect = this.brand_list[i].isSelect ? false : true;
						}
					}
				}

				if (type == 'label_list') {
					for (let i = 0; i < this.label_list.length; i++) {
						if (this.label_list[i].id == id) {
							this.label_list[i].isSelect = this.label_list[i].isSelect ? false : true;
						} else {
							this.label_list[i].isSelect = false;
						}
					}
				}
			}
		},
		// #ifdef MP-ALIPAY
		onChangeShowState_show: function() {
			var that = this;
			that.setData({
				showView: (that.showView = true)
			});
		},
		onChangeShowState_hid: function() {
			var that = this;
			that.setData({
				showView: (that.showView = false)
			});
		}
		// #endif
	};
</script>

<style scoped>
	.contents {
		background-color: #f5f5f5;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
	}

	.service-wrapper {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		text-align: center;
		color: #666666;
		font-size: 11px;
		background-color: #fff;
		align-items: center;
		margin-top: 28upx;
	}

	.service-item image {
		width: 72px;
		height: 50px;
	}

	page {
		background-color: #fff;
	}

	.search {
		position: fixed;
		z-index: 997;
		height: 104upx;
		/*  #ifndef MP-WEIXIN */
		top: 44px;
		/*  #endif  */
	}

	.screen {
		width: 100%;
		padding: 10upx 26upx 20upx;
		margin-bottom: 2upx;
		background-color: #fff;
		position: fixed;
		top: calc(44px + 222upx);
		display: flex;
		z-index: 997;
	}

	.screen-item {
		width: 20%;
		height: 50upx;
		display: flex;
		position: relative;
		align-items: center;
		justify-content: space-around;
	}

	.screents {
		border-left: 2upx solid #eee;
	}

	.screen-item-text {
		font-size: 24upx;
		color: #333;
		margin-right: 8upx;
	}

	.screen-item-icon {
		display: inline-block;
	}

	.screen-item-icon-img {
		width: 16upx;
		height: 8upx;
		display: block;
	}

	.screen-item-icon .screen-item-icon-img:first-child {
		margin-bottom: 4upx;
	}

	.list-grid {
		width: 44upx;
		height: 44upx;
		float: left;
	}

	.filter-img {
		width: 18upx;
		height: 8upx;
	}

	.img-grids {
		padding-bottom: 26upx;
	}

	.img-grids-item {
		margin-bottom: 0;
	}

	.img-grids>view,
	.img-list>view {
		overflow: hidden;
	}

	.scroll-Y {}

	.search-input-p {
		color: #888;
	}

	.order-none {
		text-align: center;
		padding: 200upx 0;
	}

	.order-none-img {
		width: 274upx;
		height: 274upx;
	}

	.fliter-c {
		width: 100%;
		/*  #ifdef  H5  */
		height: calc(100% - 44px - 184upx);
		top: calc(44px + 182upx);
		/*  #endif  */
		/*  #ifndef H5 */
		height: calc(100% - 184upx);
		top: 182upx;
		/*  #endif  */
		background: #ffffff;
		position: absolute;
		left: 0;

		padding-bottom: 90upx;
	}

	.fliter-item {}

	.fliter-item .cell-item {
		border-bottom: none;
	}

	.fliter-i-c {
		padding: 0 26upx;
		overflow: hidden;
	}

	.fic-item {
		display: inline-block;
		float: left;
		width: 160upx;
		margin-right: 14upx;
		height: 70upx;
		background-color: #f1f1f1;
		text-align: center;
		font-size: 24upx;
		margin-bottom: 14upx;
		color: #333;
		padding: 0 10upx;
	}

	.fic-item-active {
		background-color: #D62222;
		color: #fff;
	}

	.fic-item-text {
		position: relative;
		top: 50%;
		transform: translateY(-50%);
	}

	.fic-item:nth-child(4n) {
		margin-right: 0;
	}

	.fic-item-line {
		float: left;
		margin: 34upx 18upx 0 0;
		width: 50upx;
		height: 2upx;
		border-bottom: 2upx solid #ccc;
	}

	.fic-item-input {
		position: relative;
		top: 50%;
		transform: translateY(-50%);
	}

	/* #ifdef MP-ALIPAY */
	.hide {
		display: none;
	}

	.show {
		display: block;
	}

	/* #endif */
	.square {
		border-radius: 0;
	}

	.radius {
		border-radius: 12upx;
	}

	.car-title {
		z-index: 99;
		font-size: 18px;
		color: rgb(51, 51, 51);
		font-weight: bold;
		position: relative;
		height: 59px;
		background-color: #fff;
		width: 100%;
		line-height: 77px;
		padding-left: 13px;
	}

	.re-buttom {
		overflow: hidden;
		height: 48px;
		display: flex;
		flex-direction: row;
		text-align: center;
		line-height: 48px;
		font-size: 14px;
		position: fixed;
		/*#ifdef MP-WEIXIN*/
		bottom: 20px !important;
		/* #endif */
		bottom: 70px;
		right: 0;
		margin: 0 14px;
		left: 0;
		background-color: #D62222;
		border-radius: 5px;
	}

	.weixinscy {
	
	}

	.re-add {
		overflow: hidden;
		padding: 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.re-right {
		flex: 1;
		color: #FFBB7A;
	}

	.re-right image {
		width: 28px;
		height: 28px;
		vertical-align: middle;
	}

	.re-left {
		flex: 1;
		border-right: 0.5px solid #C61A1A;
		color: #FFFFFF;
	}

	.re-left image {
		width: 28px;
		height: 28px;
		vertical-align: middle;
	}

	.car-buttom {}

	.content>>>.dropdown-item__selected .selected__name {
		font-size: 14px;
	}

	.content>>>.dropdown-item__content .list__option {
		font-size: 15px;
	}

	.sticky-box {
		/* #ifndef APP-PLUS-NVUE */
		position: -webkit-sticky;
		/* #endif */
		position: sticky;
		top: var(--window-top);
		z-index: 99;
		flex-direction: row;
		margin: 0px;

	}
	.device-wrapper{
		position: relative;
		    display: flex;
		    flex-direction: row;
		    flex-wrap: wrap;
			    margin: 0 16px;
				    justify-content: space-between;
	}
	
		
	.dev-c{
		    position: absolute;
		    right: 26px;
		    /* display: block; */
		    top: 4upx;
		    font-size: 12px;
		    color: #333;
		    font-weight: normal;
	}
	
	.dev-item{
		height: 370upx;
		width: 49.4%;
	}
	.dchild-wrapper{
		display: flex;
		    flex-direction: column;
	}
		
	.dchild-item{
		height: 185upx;
		width: 100%;
	}
	.dchild-item image{
		width: 100%;
		height: 100%;
	}
	
	/**/
	.notice {
		padding: 6upx 26upx 6upx 60upx;
		position: relative;
		overflow: hidden;
		background-color: #fff;
		color: #333;
	}
	.notice-icon {
		display: inline-block;
		height: 40upx;
		position: absolute;
		top: 59%;
		left: 26upx;
		transform: translateY(-50%);
		overflow: hidden;
	}
	.news-icon {
		width: 30upx;
		height: 30upx;
		float: left;
	}
	.notice-c {
		margin-left: 10upx;
		height: 50upx;
		line-height: 50upx;
		width: 630upx;
		display: inline-block;
		font-size: 28upx;
		float: left;
	}
	
	
	/*咨询*/
		#father {
		    display: -webkit-box;
		    display: -webkit-flex;
		    display: flex;
		    -webkit-box-pack: center;
		    -webkit-justify-content: center;
		    justify-content: center;
		    -webkit-box-align: center;
		    -webkit-align-items: center;
		    align-items: center;
		    background: rgba(0, 0, 0, 0.6);
		    height: 100vh;
		    font-size: 17px;
		    font-weight: bold;
		    position: fixed;
		    z-index: 9999;
		    top: 0;
		    left: 0;
		    right: 0;
		}
		
		#son {
			width: 270px;
			height: 236px;
			background: rgba(235, 235, 235, 1);
			border-radius: 10px;
			text-align: center;
			position: relative;
		}
		
		.fee-input {
			width: 238px;
			height: 38px;
			background: rgba(255, 255, 255, 1);
			border-radius: 6px;
			line-height: 38px;
			text-align: left;
			padding-left: 17px;
			margin: 0 16px;
		}
		
		.fee-but {
			width: 87px;
			height: 38px;
			background: rgba(214, 34, 34, 1);
			border-radius: 6px;
			text-align: center;
			line-height: 38px;
			color: #FFFFFF;
			margin: 23px auto;
		}
		.father-wrapper{
			    display: flex;
			    align-items: center;
			    justify-content: center;
		}
	
</style>
